<template>
	<layout :loading="loading" curPage="companyMaps" title="站点地图">
		<map :markers="markers" :latitude="latitude" :longitude="longitude" style="width: 100%;display: block;" :style="{height : height + 'px'}"></map>
	</layout>
</template>

<script>
	export default {
		data() {
			return {
				markers:[],
				loading : true ,
				height : uni.getSystemInfoSync().windowHeight - 155
			}
		},
		computed:{
			latitude:function(e){
				if(this.markers.length == 0){
					return 39.48477 ;
				}
				return this.markers[0].latitude ;
			},
			longitude:function(e){
				if(this.markers.length == 0){
					return 115.97555 ;
				}
				return this.markers[0].longitude ;
			},
		},
		onLoad() {
			var data = {} ;
			this.kit.get("/admin/company/getMarkers",data,res => {
				this.markers = res.list ;
				
				this.loading = false ;
			});
		},
		
		methods: {
			
		}
	}
</script>

<style>

</style>
